<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <button @click="doTest">测试</button>
  </div>
</template>

<script>
import { dir, log } from 'console';
import { mapGetters } from 'vuex'
import router from '@/router';

export default {
  name: 'Dashboard',
  methods: {
    async doTest() {
      // console.log('测试带有token的请求头是否失效')
      await this.$store.dispatch('user/getUserInfo')
      
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }

  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
